<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>签到作假原因</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>

    <!--插件样式-->
    <style type="text/css">
        textarea {
            outline: none;
            resize: none;
        }
    </style>
</head>

<body>
<div id="app" style="text-align:center;width:300px;height:200px;">
    <textarea style="width:290px;height:150px;margin:0 auto;margin-top:5px;" v-model="reason"></textarea>
    <br/>
    <!-- <input type="button" value="确定驳回" @click="copierReturn" class="btn btn-primary btn-xs"/>-->
    <input type="button" value="确定驳回" @click="auditReturn" class="btn btn-primary btn-xs"/>
</div>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<script src="/dist/js/oaApp.js"></script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>

<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var app = new Vue({
        el: '#app',
        data: {
            checkedIdStrings:getUrlParamObj().checkedIdStrings,

            checkedIdString:getUrlParamObj().checkedIdString,
            userName:getUrlParamObj().userName,
            userId:getUrlParamObj().userId,
            id:getUrlParamObj().id,
            reason: '',
            type: '其他原因',
        },
        methods: {
            auditReturn: function () {

                var that = this;
                if (that.reason == "") {
                    alert("驳回原因不能为空");
                    return false;
                }

                $.wyui.postMethod(urlConfig.receivable.applyAudit, {
                    id: that.id,
                    userId: that.userId,
                    userName: that.userName,
                    auditFlag: '2',
                    checkedIdStrings:that.checkedIdStrings,
                    checkedIdString:that.checkedIdString,
                    advise: that.reason
                }, function () {
                    alert('驳回成功')
                    // parent.frameElement.api.close();
                    api.close()
                });
            },
        }
    });
</script>
</body>
</html>